<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <title>后台管理系统</title>
        <style>
            body { margin:0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background:#f5f7fa; }
            .sidebar {
                width: 220px; background: #5a4e9a; color: white; height: 100vh; position: fixed;
                display: flex; flex-direction: column;
            }
            .sidebar a {
                color: white; text-decoration: none; padding: 15px 20px; display: block;
                border-left: 4px solid transparent;
            }
            .sidebar a:hover,
            .sidebar a.active {
                background: #7a6ccc; border-left: 4px solid #d3c9ff;
            }
            .header {
                margin-left: 220px; height: 60px; background: white; box-shadow: 0 2px 8px rgb(0 0 0 / 0.1);
                display: flex; align-items: center; justify-content: flex-end; padding: 0 20px;
            }
            .header a {
                color: #5a4e9a; text-decoration: none; font-weight: 600;
            }
            .content {
                margin-left: 220px; padding: 20px; min-height: calc(100vh - 60px);
            }
            h1 { color: #5a4e9a; }
            button {
                background: linear-gradient(135deg, #a188ff, #7a6ccc);
                border: none; color: white; padding: 6px 12px; border-radius: 6px;
                cursor: pointer;
                transition: background 0.3s ease;
            }
            button:hover {
                background: linear-gradient(135deg, #c2b7ff, #9587d7);
            }
            input[type=text], input[type=number], select {
                padding: 8px 10px; border-radius: 6px; border: 1px solid #ccc; width: 100%;
                box-sizing: border-box;
                margin-top: 6px; margin-bottom: 16px;
            }
            .form-group {
                margin-bottom: 20px;
            }
            label {
                font-weight: 600; color: #555;
            }
            .actions {
                margin-top: 20px;
            }
        </style>
    </head>
    <body>
    <div class="sidebar">
        <h2 style="text-align:center; margin:20px 0; font-weight:700;">后台管理</h2>
        <a href="${pageContext.request.contextPath}/admin/product/list" class="<%= request.getRequestURI().contains("/admin/product") ? "active" : "" %>">商品管理</a>
        <a href="${pageContext.request.contextPath}/admin/category/list" class="<%= request.getRequestURI().contains("/admin/category") ? "active" : "" %>">分类管理</a>
        <a href="${pageContext.request.contextPath}/admin/group/list" class="<%= request.getRequestURI().contains("/admin/group") ? "active" : "" %>">拼团活动管理</a>
        <a href="${pageContext.request.contextPath}/admin/order/list" class="<%= request.getRequestURI().contains("/admin/order") ? "active" : "" %>">订单管理</a>
    </div>
    <div class="header">
        <a href="${pageContext.request.contextPath}/fron/login">退出登录</a>
    </div>

    <div class="content">
        <h1>修改订单状态</h1>
        <form action="${pageContext.request.contextPath}/admin/order/changeStatus" method="post">
            <input type="hidden" name="orderId" value="${order.id}">
            <div class="form-group">
                <label>订单状态</label>
                <select name="status">
                    <option value="待支付" ${order.status=='待支付'?'selected':''}>待支付</option>
                    <option value="已支付" ${order.status=='已支付'?'selected':''}>已支付</option>
                    <option value="已发货" ${order.status=='已发货'?'selected':''}>已发货</option>
                    <option value="已完成" ${order.status=='已完成'?'selected':''}>已完成</option>
                    <option value="已取消" ${order.status=='已取消'?'selected':''}>已取消</option>
                </select>
            </div>
            <div class="actions">
                <button type="submit">保存</button>
                <a href="${pageContext.request.contextPath}/admin/order/list">
                    <button type="button">取消</button></a>
            </div>
        </form>
    </div>
    </body>
</html>